package org.activequant.data.retrieval;

import org.activequant.core.domainmodel.InstrumentSpecification;
import org.activequant.core.domainmodel.marketdepth.MarketDepthEvent;
/**
 * Interface for a live market depth data feed.<br>
 * An interface. Defines the following methods:
 * <ul>
 * <li>ISubscription&lt;MarketDepthEvent&gt; subscribe(InstrumentSpecification spec) throws Exception;</li>
 * <li>ISubscription&lt;MarketDepthEvent&gt;[] getSubscriptions();</li>
 * </ul>
 * <br>  
 * <b>History:</b><br>
 *  - [23.10.2007] Created based on Mike Kroutikov's code + IDataSource (Erik Nijkamp)<br>
 *  
 *  @author Mike Kroutikov
 *  @author Erik Nijkamp
 *
 */
public interface IMarketDepthEventSubscriptionSource {

	/**
	 * Subscribes a new market depth subscription for a specific instrument.
	 * @param spec
	 * @return
	 * @throws Exception
	 */
	ISubscription<MarketDepthEvent> subscribe(InstrumentSpecification spec) throws Exception;

	/**
	 * Returns collection of current subscriptions (excluding the canceled ones).
	 *
	 * @return subscriptions.
	 */
	ISubscription<MarketDepthEvent>[] getSubscriptions();

}